/**
 *Copyright (c) 2024 watereyes
 * safetymanagement is licensed under Mulan PubL v2.
 * You can use this software according to the terms and conditions of the Mulan
 * PubL v2.
 * You may obtain a copy of Mulan PubL v2 at:
 *          http://license.coscl.org.cn/MulanPubL-2.0
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
 * See the Mulan PubL v2 for more details.
 */
package com.koron.hiddendanger.service.api;

import com.koron.common.bean.StaffBean;
import com.koron.common.domain.DataBean;
import com.koron.hiddendanger.bean.CheckRecordAtrrBean;
import com.koron.hiddendanger.bean.CheckRecordReport;
import com.koron.hiddendanger.domain.CheckRecord;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.springframework.web.multipart.MultipartFile;
import org.swan.bean.MessageBean;

import java.io.InputStream;
import java.util.List;

public interface CheckRecordService {
    /**
     * 保存检查记录
     *
     * @param user
     * @param checkRecord
     * @param inspectorsSignFile
     * @param keepInspectorsSignFile
     * @param delInspectorsSignFile
     * @param signFile
     * @param keepSignFile
     * @param delSignFile
     * @return
     */
    MessageBean<String> save(StaffBean user, CheckRecord checkRecord, MultipartFile[] inspectorsSignFile, String keepInspectorsSignFile, String delInspectorsSignFile, MultipartFile[] signFile, String keepSignFile, String delSignFile);

    /**
     * 提交填写的检查记录
     * @param id
     * @return
     */
    MessageBean<Integer> commit(StaffBean user, String id, String jobsTasksId);

    /**
     * 删除指定检查记录
     *
     * @param user
     * @param idList
     * @return
     */
    MessageBean<Integer> batchDelete(StaffBean user, List<String> idList);

    /**
     * 根据主键查询检查记录详情
     *
     * @param user
     * @param id
     * @return
     */
    MessageBean<CheckRecord> queryOne(StaffBean user, String id);

    /**
     * 根据指定条件查询检查记录列表
     * @param corpCode
     * @param gridCode
     * @param manager
     * @param planType
     * @param submit
     * @param start
     * @param rows
     * @return
     */
    MessageBean<DataBean<CheckRecord>> queryByCondition(StaffBean user,String userCode,String planId,String corpCode,String gridCode,String manager, Integer planType,
                                                        Integer submit,  Integer start, Integer rows,String keyword);

    /**
     * 查询某个计划下的所有检查记录，可按条件查询
     * @param planId
     * @param corpCode
     * @param gridCode
     * @param manager
     * @param planType
     * @param submit
     * @param start
     * @param rows
     * @return
     */
    MessageBean<DataBean<CheckRecord>> queryByPlanId(String planId,String corpCode,String gridCode,String manager, Integer planType,
                                                        Integer submit,  Integer start, Integer rows);

    /**
     * 保存检查记录使用的附件信息
     * @param id
     * @param file
     * @return
     */
    MessageBean<Integer> saveAttachment(String id,MultipartFile[] file);

    /**
     * 根据检查记录id获取检查记录的附件列表
     * @param checkId
     * @return
     */
    MessageBean<List<CheckRecordAtrrBean>> fileList(String checkId);

    /**
     * 根据检查记录id和附件地址删除附件
     * @param id
     * @param fileAddress
     * @param fileName
     * @return
     */
    MessageBean<Integer> deleteFile(String id,String fileAddress,String fileName);

    /**
     * 预览报告的数据
     * @param id
     * @return
     */
    MessageBean<CheckRecordReport> viewReport(String id);

    MessageBean<DataBean<CheckRecord>> indexCheckRecordList(String code,Integer start,Integer rows);

    XSSFWorkbook exportReport(String id, InputStream inputStream);

    List<CheckRecord> exportList(StaffBean user, String corpCode, String userCode, String planId, String gridCode, String manager, Integer planType, Integer submit);

    MessageBean<DataBean<CheckRecord>> homePageCheckList(StaffBean user, String userCode, String planId, String corpCode, String gridCode, String manager, Integer planType, Integer submit, Integer start, Integer pageSize);
}
